n = int(input())
lst = list(map(int, input().split()))

for i in range(0, n):
    min_value = int(lst[i])
    min_locate = i
    for j in range(i, n):
        b = int(lst[j])
        if b < min_value:
            min_value = b
            min_locate = j
    lst[min_locate] = lst[i]
    lst[i] = min_value
    print(min_value)

print(lst)
